UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mCqBZrk86lmJ+lO+L5UPJwBv1J3qoNZMfh7eUUv10p4=' 
WHERE 
  key_id = '1993d2674db39a3a696866b744e4a24f8d7fdd0fcd511dad5af53cccd572eb62' 
  AND (
    token = 'mCqBZrk86lmJ+lO+L5UPJwBv1J3qoNZMfh7eUUv10p4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031