UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MIbxZwPeaPuhbDkyr3Qf7eLfOUZoAr0itUnZpI81l3o=' 
WHERE 
  key_id = '71c2fe597c814239307dbdae9b9a6ae3b9cb786549786f6e82ebe03b709f6a3a' 
  AND (
    token = 'MIbxZwPeaPuhbDkyr3Qf7eLfOUZoAr0itUnZpI81l3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024