UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dIFoBSP4HANaFQeSDoH5Xs9bY7iVnRN26e2YkRb9ucY='
WHERE
key_id = '1dc43412a09cae27078eb05fa87a3a462c5af5846e78f3d9381bd42a3d36a980'
AND (
token = 'dIFoBSP4HANaFQeSDoH5Xs9bY7iVnRN26e2YkRb9ucY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)