UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jjiVummm5xj4sbYxqu/8sSqQIhXiL7xqixd+oUkY7K4=' 
WHERE 
  key_id = '5ac84310eda74db7ffbfef84f613c71980e422fd29240c01a6454a9efb587334' 
  AND (
    token = 'jjiVummm5xj4sbYxqu/8sSqQIhXiL7xqixd+oUkY7K4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033