UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dtxBOSr3Nk9RGDdGCHeBkAf8QkldL5kT9pGBLYpIWTc='
WHERE
key_id = '19ebae22a40129e0756b582442b17efab982747485b069bc773568a8836643ae'
AND (
token = 'dtxBOSr3Nk9RGDdGCHeBkAf8QkldL5kT9pGBLYpIWTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)