UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0F7tEqva/L7EOwnOBuMXuA0VkrlD5HdJ1324TP/2RY='
WHERE
key_id = '18714e31fa111ad49aeb8ba8206c743472d7536c3debee3b70d6580e1410ff82'
AND (
token = 'K0F7tEqva/L7EOwnOBuMXuA0VkrlD5HdJ1324TP/2RY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)