UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uK9wCL5y1AUV54gzZi1i9X4NjiMpIIJfTw1ZSHOFXQo=' 
WHERE 
  key_id = 'b028120174d63b9a61534dc13e7ff84d60af7d056cec211c31eeeb1a1987b9b8' 
  AND (
    token = 'uK9wCL5y1AUV54gzZi1i9X4NjiMpIIJfTw1ZSHOFXQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017