UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ddOXJ+UL0EsHzfls29v3mGlgxqwYjX5Zai/IzONolDw=' 
WHERE 
  key_id = 'bd1235e6631d01ad91898955a447288bff5cc9363fa09bbc1dc9741591ecf2a9' 
  AND (
    token = 'ddOXJ+UL0EsHzfls29v3mGlgxqwYjX5Zai/IzONolDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017