UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/gCgUI0PKd70yr2GppiTfZ4wSJOPMQiYUaQkIHDnGg='
WHERE
key_id = 'f6608a57d10da3730ef1c156adf91d5e61a4332373948a181404369e806485b4'
AND (
token = '2/gCgUI0PKd70yr2GppiTfZ4wSJOPMQiYUaQkIHDnGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)