UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yF8fZuUTOWdNWW1efDgdC1RGdJMN9ic7rp48l3d8ZdA='
WHERE
key_id = '25cb862a7f27023708938b8c58266d4bb71a934174ee988811fcd51e0d1f3002'
AND (
token = 'yF8fZuUTOWdNWW1efDgdC1RGdJMN9ic7rp48l3d8ZdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)