UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3cPowKm38iRmy86+oLgAviycj2MGw1SRZHj/NPWk4aU=' 
WHERE 
  key_id = '8d89aa040b9cab22091c803a78593373cd5848836677f6148c3f67dba912720c' 
  AND (
    token = '3cPowKm38iRmy86+oLgAviycj2MGw1SRZHj/NPWk4aU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031