UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCZxDisOeaKKEbrl1Fs/yUhUgt5f6qAVZzDCEeLEsq8=' 
WHERE 
  key_id = '94980370b76f6c3623496bffff6686ffc19eab7b175b08bfb4ba0e4420df03b0' 
  AND (
    token = 'UCZxDisOeaKKEbrl1Fs/yUhUgt5f6qAVZzDCEeLEsq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021