UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDypmA6pP3gr6UuhldAD84rBR3oFGEE+kQCLXa33isU=' 
WHERE 
  key_id = '0419fcaf297a67082efc7c1f3582a20f2e140231cf7aeeb3fc34309cf225e8f0' 
  AND (
    token = 'RDypmA6pP3gr6UuhldAD84rBR3oFGEE+kQCLXa33isU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033