UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1jph5awfgAlaDTOLk3Mwm/W1ZTTX0mNzdJO2/BEZv5s=' 
WHERE 
  key_id = '27458a4cd24152b6cbbaaf8cadca698119bc56c19df9cd107d3499d1041a9bd1' 
  AND (
    token = '1jph5awfgAlaDTOLk3Mwm/W1ZTTX0mNzdJO2/BEZv5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028