UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZlkUbxP3w7Z34Ryi7OBr+K1VgHGGmG9G3YTSCVoVaAs='
WHERE
key_id = '8a27f85fb071aed19937ab26ceb6417c691fdcde8d765b66bc9314951c0c4e57'
AND (
token = 'ZlkUbxP3w7Z34Ryi7OBr+K1VgHGGmG9G3YTSCVoVaAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)