UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '21lH3CZPSbVMjC1Nd8kAXBiZAF/ev9pPexNeYqD2TQ8=' 
WHERE 
  key_id = '1e865de853ad1b497cf2562eac8ac9d6e47ecaffcb684007d525ac755fddb8c1' 
  AND (
    token = '21lH3CZPSbVMjC1Nd8kAXBiZAF/ev9pPexNeYqD2TQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041