UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '10RAKurERmbvBEW9BGJKLIwVMVsSSDE7HTE6AkCgp8o=' 
WHERE 
  key_id = '6e860352d1d124732df69ff75b79f4c7187ef368ac7ca3fe9df731685510402f' 
  AND (
    token = '10RAKurERmbvBEW9BGJKLIwVMVsSSDE7HTE6AkCgp8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031