UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HmDPpa/PqKeXOn+D4knkgdPh6/+kou51e2WC/CD03zA=' 
WHERE 
  key_id = '3d7a3461c6bcb7ba67aa4d1424a1dc0f5a7dad247843bfe52ad944f22eb330e8' 
  AND (
    token = 'HmDPpa/PqKeXOn+D4knkgdPh6/+kou51e2WC/CD03zA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039