UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IWj5VH+jdk7kVuFMbp8Bo3iWfZd+7JFHcTVHQIn8Ly4='
WHERE
key_id = '9278b4af607b75d8346791e92d490c8887b31e3a1328c8fbce229211726fbb11'
AND (
token = 'IWj5VH+jdk7kVuFMbp8Bo3iWfZd+7JFHcTVHQIn8Ly4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)