UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nC/La6m5HOoeJ23270oSdqCV+imjTJ/iRemMRi5K1LQ='
WHERE
key_id = 'c18946b091d8bdc93dba685e6cedbdfc42e59304bb38cf7f4bd85904218cc13e'
AND (
token = 'nC/La6m5HOoeJ23270oSdqCV+imjTJ/iRemMRi5K1LQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)