UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tt3gsanwFBrDhYKHCYzUTq+iFUseEKwYe/Ci2dUV2O0='
WHERE
key_id = '5cd48045c707876e4549393b1e4768b75e6a9394e7cd1f89a4a064fb36fd68e7'
AND (
token = 'tt3gsanwFBrDhYKHCYzUTq+iFUseEKwYe/Ci2dUV2O0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)