UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j1LkF2MH32DbN7cnKyeLDPRTmUpE++Q39RmhmPlY8M8='
WHERE
key_id = '1546fb8a70993cc92fc8bf6911da20990a63f5f09fe667962c236dcf365d624c'
AND (
token = 'j1LkF2MH32DbN7cnKyeLDPRTmUpE++Q39RmhmPlY8M8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)