UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RsQbejrkjKFO9BPBeEMBjD40KYffBJFzR/5xIvccmc=' 
WHERE 
  key_id = '94a3f885ae3339ce79ad0e52aa156b4a7a05db3af9351eb02c810e9daa304a49' 
  AND (
    token = '0RsQbejrkjKFO9BPBeEMBjD40KYffBJFzR/5xIvccmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045