UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k+2co8Bgak8U5o1hSdeDICah9iPhPcDuwAbfCw90THI='
WHERE
key_id = '5ef76be0215e61a9ac40c8fa4fafcab72c24930addca0a4ea5ba26b3bef9fcdc'
AND (
token = 'k+2co8Bgak8U5o1hSdeDICah9iPhPcDuwAbfCw90THI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)