UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FLFhMcaQQkbraIzFWTPvMQSfcN04k7CPpFLw442qi/U='
WHERE
key_id = '820d6129cfc83ad2d821c21f64781c03683e96ff3a2bbc106a1f45739d348ccc'
AND (
token = 'FLFhMcaQQkbraIzFWTPvMQSfcN04k7CPpFLw442qi/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)