UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvZZ//bpKOQS2Wknjo0PQ20wu1sORLmM/2EbkrfIxJw=' 
WHERE 
  key_id = '18a9b10c2838a733a30d1e9f8c2ff1f5fefb330979a6f789cc6f2984a59720b8' 
  AND (
    token = 'dvZZ//bpKOQS2Wknjo0PQ20wu1sORLmM/2EbkrfIxJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029