UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hECBf+0sozNhAr5ZQzi3MhCHGiN/gJv4S8Fe/0X8v4U='
WHERE
key_id = '8a2b8a269407bf06364f02bfef2c37ef28204571363f3d3bbed56d07de91482a'
AND (
token = 'hECBf+0sozNhAr5ZQzi3MhCHGiN/gJv4S8Fe/0X8v4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)