UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oJbAAA//fNLLcRB76l1xDi3JzDPFVKaIGKGCGrEKN0o=' 
WHERE 
  key_id = '41139ddb99175957c8697b6e9d31bcc6ab1744827437b6621b6380a18ea54e1d' 
  AND (
    token = 'oJbAAA//fNLLcRB76l1xDi3JzDPFVKaIGKGCGrEKN0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053