UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7QqYU62ojTJsxpuJc8hWxbTMdIjSOijIwY3WiPVIQKM=' 
WHERE 
  key_id = '2e87026b7ecf4ffdbc8b260109bc2f3b7abb5064b015066fc462eb4b15c442aa' 
  AND (
    token = '7QqYU62ojTJsxpuJc8hWxbTMdIjSOijIwY3WiPVIQKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00169