UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+jg66InVT6AiUulv41sDYADS9WFHo+uOfUUUKlbGtd8='
WHERE
key_id = 'a2194d0ee72f456fee664e6eaab9b8e77c26fd1690ee8487b728872639c434db'
AND (
token = '+jg66InVT6AiUulv41sDYADS9WFHo+uOfUUUKlbGtd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)