UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o8U+0KuDJu8Mh3pWMpXj5jsQKP5f8O+M7H7n47Zjg7o=' 
WHERE 
  key_id = '760b4d775c6ab713e0ca3d19a0ad0c0a595ef3e0598bf8606121b538a6526ea4' 
  AND (
    token = 'o8U+0KuDJu8Mh3pWMpXj5jsQKP5f8O+M7H7n47Zjg7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030