UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '89U89TdaQsEhLjWNPcG77agfUV0yXN/CPYqx6iJv+5o='
WHERE
key_id = '55ab59839afe028b333aab35274e25d51296a1ffed8f96a0a937626285f92591'
AND (
token = '89U89TdaQsEhLjWNPcG77agfUV0yXN/CPYqx6iJv+5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)