UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HnQltenGsLl07/mjiMRYGli0v1LWCH/5mbfN3UAMYw='
WHERE
key_id = '6de151af39991081b7b1e17acae02fe0eefdf4b4b139ab2fec8d68a231b08e91'
AND (
token = '5HnQltenGsLl07/mjiMRYGli0v1LWCH/5mbfN3UAMYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)