UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'alaXat4u+k01VtUCtNDd9YTykXnO+/ydONOUuvxS2xQ=' 
WHERE 
  key_id = 'a894060bd7a45e09cc36d7a8499423ca5a9e2a0839b40328847641ad831b65f0' 
  AND (
    token = 'alaXat4u+k01VtUCtNDd9YTykXnO+/ydONOUuvxS2xQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069